package com.example.fist.entity;

import javax.persistence.*;
import java.sql.Timestamp;
import java.util.Date;
import java.util.Objects;

@Entity
@Table(name = "college", schema = "competition", catalog = "")
public class CollegeEntity {
    private int coId;
    private Integer shId;
    private String coName;
    private String note;
    private int isvisible;
    private Date coTime;

    @Id
    @Column(name = "co_id", nullable = false)
    public int getCoId() {
        return coId;
    }

    public void setCoId(int coId) {
        this.coId = coId;
    }

    @Basic
    @Column(name = "sh_id", nullable = true)
    public Integer getShId() {
        return shId;
    }

    public void setShId(Integer shId) {
        this.shId = shId;
    }

    @Basic
    @Column(name = "co_name", nullable = false, length = 20)
    public String getCoName() {
        return coName;
    }

    public void setCoName(String coName) {
        this.coName = coName;
    }

    @Basic
    @Column(name = "note", nullable = false, length = -1)
    public String getNote() {
        return note;
    }

    public void setNote(String note) {
        this.note = note;
    }

    @Basic
    @Column(name = "isvisible", nullable = false)
    public int getIsvisible() {
        return isvisible;
    }

    public void setIsvisible(int isvisible) {
        this.isvisible = isvisible;
    }

    @Basic
    @Column(name = "co_time", nullable = false)
    public Date getCoTime() {
        return coTime;
    }

    public void setCoTime(Date coTime) {
        this.coTime = coTime;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        CollegeEntity that = (CollegeEntity) o;
        return coId == that.coId &&
                isvisible == that.isvisible &&
                Objects.equals(shId, that.shId) &&
                Objects.equals(coName, that.coName) &&
                Objects.equals(note, that.note) &&
                Objects.equals(coTime, that.coTime);
    }

    @Override
    public int hashCode() {
        return Objects.hash(coId, shId, coName, note, isvisible, coTime);
    }
}
